#include<stdio.h>
#include<stdlib.h>
#include <conio.h>
int main()
{
    int i,j;
    int x=10,y=10;
    int fire=0;
    int ny=5,killed=0;
    char input;

    while(1)
    {
        system("cls");
        if(!killed)
        {
            for(j=1;j<=ny;j++)
                printf(" ");
            printf("+\n");
        }
        if(fire==0)
        {
            for(i=1;i<=x;i++)
                printf("\n");
        }
        else
        {
            for(i=1;i<=x;i++)
            {
                for(j=1;j<=y;j++)

                    printf(" ");
                printf("  |\n");


            }
            if(y+2==ny)
                killed=1;
            fire=0;

        }

        for(j=1;j<=y;j++)
            printf(" ");
        printf("  *\n");
        for(j=1;j<=y;j++)
            printf(" ");
        printf("*****\n");
        for(j=1;j<=y;j++)
            printf(" ");
        printf(" * *\n");

        if(kbhit())
        {
            input=getch();
            if(input=='a')
                y--;
            if(input=='d')
                y++;
            if(input=='w')
                x--;
            if(input=='s')
                x++;
            if(input==' ')
                fire=1;
        }


    }
    return 0;
}
